<?php if (!defined('BASEPATH')) exit('No direct script access allowed.');?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户激活 - Qiqu taobao</title>
<script src="/mysite/js/jquery-1.3.2.min.js" type="text/javascript"></script>
<link href="/mysite/images/activation.css" rel="stylesheet"
	type="text/css">
<link
	href="http://sf.panli.com/FrontEnd/images20090801/favicon.ico?v=3.0"
	type="image/ico" rel="shortcut icon">
<script type="text/javascript">
        function emailInputShow(e) {
            if (e && e.stopPropagation) {
                e.stopPropagation();
            }
            else {
                window.event.cancelBubble = true;
            }
            $('#bgdiv').show();
            $("#changeEmail").show(0, function() { $("#codeImage").click(); });
            $("#changeEmailCode").val("");
            $("#cEmail").removeAttr("class").text("此邮箱将作为您登录Qiqu taobao的帐号！");
            $("#cemailinput").val("");
        }

        function changeEmail(e) {
            if (e && e.stopPropagation != undefined) { e.stopPropagation(); }
            else { window.event.cancelBubble = true; }

            var checkCode = $.trim($("#changeEmailCode").val());
            if (checkCode.length <= 0) {
                $("#cEmail").attr("class", "red").text("请输入验证码！"); return;
            }

            $.ajax({
                type: "get",
                url: "<?php echo REGISTER_PAGE() . '/iscodevalid?code='; ?>" + checkCode,
                dataType: "text",
                timeout: 5000,
                error: function(a, b, c) { 
                    checkcodechecked = true; 
                    $("#cEmail").removeAttr("class").text("此邮箱将作为您登录Qiqu taobao的帐号！"); 
                    changeEmailSuc(); },
                success: function(msg) {
                    if (msg == 'false') {
                        $("#cEmail").attr("class", "red").text("验证码错误！"); 
                        return;
                    }
                    else {
                        $("#cEmail").removeAttr("class").text("此邮箱将作为您登录Qiqu taobao的帐号！");
                        changeEmailSuc();
                    }
                }
            });
        }
        

        function changeEmailSuc() {
            var email = $("#cemailinput").val();
            if (email.length <= 0) { 
                $("#cEmail").attr("class", "red").text("请输入您的Email地址！"); 
                return; 
            }
            var reg = new RegExp("\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*");
            if (reg.test($("#cemailinput").val())) {
                $.ajax({
                    type: "get",
                    url: "<?php echo REGISTER_PAGE() . '/changeemail?oldemail=' . $reg_email ; ?>&newemail=" + email,
                    dataType: "text",
                    contentType: "application/json;utf-8",
                    timeout: 10000,
                    beforeSend: function() { 
                        $("#cEmail").attr("class", "lv").text("正在修改您的Email，请稍候！"); 
                        $("#changeEmailBtn").attr("disabled", "disabled"); 
                       },
                    error: function() {
                         $("#cEmail").attr("class", "red").text("网络连接失败！"); 
                         $("#changeEmailBtn").removeAttr("disabled"); 
                       },
                    success: function(rstr) {
                        if (rstr == "error") { window.location = "/"; return; }
                        if (rstr == "used") { $("#cEmail").attr("class", "red").text("该Email地址已经被使用！"); }
                        if (rstr == "nouser") { $("#cEmail").attr("class", "red").text("Email地址修改失败！"); }
                        if (rstr == "again") { $("#cEmail").attr("class", "red").text("您操作过于频繁，请过10分钟后再试！"); }
                        if (rstr == "success" || rstr == "fail") { 
                              $("#cEmail").text("已成功修改您的Email并发送新的激活邮件，请注意查收！"); 
                              $("#changeEmail").hide(); 
                              $("#registerEmail").html(email); 
                              $("#successChange").show(); 
                        }
                        if (rstr == "wrong") { $("#").attr("class", "red").text("您输入的Email地址格式不正确！"); }
                        $("#changeEmailBtn").removeAttr("disabled");
                    }
                });
            }
            else {
                $("#").attr("class", "red").text("您输入的Email地址不正确！");
            }
        }
        
        function reSendEmail() {
            $.ajax({
                type: "GET",
                url: "<?php echo REGISTER_PAGE(). '/resendactivationemail?email=' ; ?>" + $("#registerEmail").text(),
                dataType: "text",
                contentType: "application/json;utf-8",
                timeout: 10000,
                error: function() { 
                    alert("网络连接失败，请稍后再试！"); 
                },
                success: function(msg) { 
                    if (msg == "success") { 
                        alert("新的激活邮件已经发送到您的邮箱，请注意查收！"); 
                    } 
                    else { 
                        if (msg == "again"){ 
                            alert("您发送邮件过于频繁，请过10分钟后再试");
                        }     
                        else { 
                            if (msg == "approved") { 
                                alert("您的帐号已经激活！请前往登陆"); 
                                window.location = "<?php echo LOGIN_PAGE(); ?>" 
                            } 
                            else { 
                                alert("激活邮件发送失败！"); 
                            } 
                        } 
                    }
                }   
            });
        }
        

        $(document).ready(function() {
            $("#changeEmail").click(function(e) { if (e && e.stopPropagation) { e.stopPropagation(); } else { window.event.cancelBubble = true; } });
            $("#successChange").click(function(e) { if (e && e.stopPropagation) { e.stopPropagation(); } else { window.event.cancelBubble = true; } });
            $(document).click(function(e) {
                if ($("#changeEmail:hidden").length > 0) {
                    //if ($.trim($("#cemailinput").val()).length == 0) $("#cemailinput").attr("class", "c1").val("请输入Email地址");
                    $("#cEmail").removeAttr("class").text("此邮箱将作为您登录Qiqu taobao的帐号！");
                } $("#changeEmail").hide(); $('#bgdiv').hide(); $("#successChange").hide();
            });
        });
    </script>
<script type="text/javascript"
	src="chrome-extension://dlnembnfbcpjnepmfjmngjenhhajpdfd/resources/LocalScript.js"></script>
<script type="text/javascript"
	src="chrome-extension://dlnembnfbcpjnepmfjmngjenhhajpdfd/libraries/DataExchangeScript.js"></script>
</head>
<body>
	<form name="Form1" method="post"
		action="http://passport.panli.com/Register/Default.aspx" id="Form1">
		<div></div>
		<div class="top">
			<div class="logo">
				<a href="http://www.panli.com/"> <img src="/mysite/images/logo.gif"
					alt="Panli代购">
				</a>
			</div>
			<div class="hy">
				<img src="/mysite/images/jihuo.gif" alt="找回密码">
			</div>
			<div class="T_right">
				<a href="http://www.panli.com/">返回首页</a><span>|</span><a
					href="http://www.panli.com/Help/">帮助信息</a>
			</div>
		</div>
		<div class="center">
			<div class="bz">
				<h2>只差一步咯，快去激活您的帐户吧！</h2>
				<p>
					系统已重新发送一封激活邮件到您的邮箱：<span id="registerEmail"><?php echo $reg_email; ?>
					</span>，请在24小时内激活！
				</p>
			</div>
			<div class="yaunyin">
				<ul>
					<li>确认邮件是否被你提供的邮箱系统自动拦截，或被误认为垃圾邮件放到垃圾箱了。</li>
					<li>如果超过10分钟您仍然未收到激活信，请您：<b><a onclick="reSendEmail()"
							href="javascript:;">重发激活信</a> </b>
					</li>
					<li class="qu">如果再次发送激活信还没收到，请试试：<b><a
							onclick="emailInputShow(event)" href="javascript:;">更换其他邮箱</a> </b>
						<div class="floor" id="bgdiv" style="display: none;"></div>
						<div id="changeEmail" class="change" style="display: none">
							<a href="javascript:;"
								onclick="$('#changeEmail').hide();$('#bgdiv').hide();"
								class="close" title="关闭"></a>
							<p id="cEmail">此邮箱将作为您登录panli的帐号！</p>
							<table>
								<tbody>
									<tr>
										<td class="zuo">邮箱地址：</td>
										<td><input id="cemailinput" class="c1" type="text"></td>
									</tr>
									<tr>
										<td class="zuo">验证码：</td>
										<td><input class="c3" id="changeEmailCode" type="text"> <img
											id="codeImage"
											src="<?php echo CAPTCHA_IMG(); ?>"
											title="点击图片刷新" alt="验证码"
											style="vertical-align: middle; cursor: pointer; width: 120px; hegith: 26px;"
											onclick="this.src=<?php echo CAPTCHA_IMG_RAN(); ?> "
											border="0">
										</td>
									</tr>
								</tbody>
							</table>
							<input id="changeEmailBtn" class="c2"
								onclick="changeEmail(event);" name="" type="button" value="确定发送"
								onmouseover="this.className='c2_'"
								onmouseout="this.className='c2'">
						</div>
						<div id="successChange" class="change" style="display: none">
							<a href="javascript:;"
								onclick="$('#successChange').hide();$('#bgdiv').hide();"
								class="close" title="关闭"></a>
							<div class="ch_top">
								已向您的新邮箱发送验证邮件！<br> 点击邮件中的链接地址，即可完成验证！
							</div>
							<p class="tishi">此邮箱将作为您登录Qiqu taobao的帐号！</p>
						</div>
					</li>
				</ul>
			</div>
			<div class="yj"></div>
		</div>
		<div class="foot">
			<p>
				<a href="http://hr.panli.com/" target="_blank">关于我们</a>&nbsp;|&nbsp;<a
					href="http://www.panli.com/news/about.aspx?nid=5">联系我们</a>&nbsp;|&nbsp;<a
					href="http://hr.panli.com/job_index.aspx" target="_blank">加入Panli</a><span>&nbsp;|&nbsp;<a
					href="http://www.panli.com/news/about.aspx?nid=14">友情链接</a>
				</span>
			</p>
			Copyright ©2012 Panli All rights reserved
		</div>
	</form>
</body>
</html>
